﻿using Architecture.Api.Application.Commands.SlaughterCommand;
using Architecture.Domain.Services.Interface;
using Architecture.Domian.DTO;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.SlaughterHandler
{
    public class CultrueQueryCorporationPicCommandHandler : IRequestHandler<SlaughterCorporationQuerySlaughterPicCommand, List<PictureDTO>>
    {

        private readonly ISlaughterService _slaughterservice;

        public CultrueQueryCorporationPicCommandHandler(ISlaughterService slaughterservice)
        {
            _slaughterservice = slaughterservice;
        }

        public async Task<List<PictureDTO>> Handle(SlaughterCorporationQuerySlaughterPicCommand request, CancellationToken cancellationToken)
        {
            return await _slaughterservice.GetCorporationPicture(request.productionLot, request.slaughteringCompanyId);
        }

    }
}
